<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/custom.form.css">
    <style>
        .layui-table-box{
            overflow: visible;
        }
        .layui-table-box{
            overflow: visible;
        }
        .layui-table-header{
            overflow: visible;
        }
        .layui-table-box{
            overflow: visible;
        }
        .layui-table-main{
            overflow: visible;
        }
    </style>
</head>
<body>
<input type="hidden" th:value="${swryDm}" id="swryDm"/>
<input type="hidden" th:value="${swjgDm}" id="swjgDm"/>
<input type="hidden" th:value="${ajztDm}" id="ajztDm"/>
<!--<div class="cqyj_table_div">-->
<!--    <form class="layui-form" method="post">-->
<!--        <div class="layui-form-item">-->
<!--            <div class="layui-input-inline">-->
<!--                <input type="text" id="nsrsbh" class="layui-input" autocomplete="off" placeholder="请输纳税人识别号">-->
<!--            </div>-->

<!--            <div class="layui-input-inline">-->
<!--                <input type="text" id="nsrmc" class="layui-input" autocomplete="off" placeholder="请输入企业名称">-->
<!--            </div>-->

<!--            <div class="layui-input-inline">-->
<!--                <input type="text" id="ajbh" class="layui-input" autocomplete="off" placeholder="请输案件编号">-->
<!--            </div>-->

<!--            <div class="layui-input-inline">-->
<!--                <input type="text" readonly class="layui-input" id="lasjTime" placeholder="立案时间">-->
<!--            </div>-->

<!--            <div class="layui-input-inline">-->
<!--                <input type="text" readonly class="layui-input" id="zxwbsjTime" placeholder="执行完毕时间">-->
<!--            </div>-->

<!--            <div class="layui-input-inline">-->
<!--                <input type="text" readonly class="layui-input" id="jasjTime" placeholder="结案时间">-->
<!--            </div>-->
<!--                <div class="layui-input-inline" style="width: 370px;" id="ajztDm">-->
<!--                </div>-->
<!--            <div class="layui-input-inline" style="margin-top: 8px">-->
<!--&lt;!&ndash;                <button class="layui-btn" onclick="search()" id="search">查询</button>&ndash;&gt;-->
<!--                <button type="button" class="layui-btn" lay-submit="" lay-filter="demo">查询</button>-->
<!--            </div>-->


<!--    </div>-->
<!--    <table class="layui-hide" id="ajcx_table" lay-filter="ajcx_table"></table>-->
<!--    </form>-->
<!--</div>-->
<div class="cqyj_table_div">
<table class="layui-hide" id="ajcx_table" lay-filter="ajcx_table"></table>
</div>
<div class="ajxx_record_div" hidden>
    <table class="layui-hide" id="flowRecord_table" lay-filter="flowRecord_table"></table>
</div>

<div class="log_record_div" hidden>
    <table class="layui-hide" id="logRecord_table" lay-filter="logRecord_table"></table>
</div>
</body>
<script type="text/html" id="ajxxtool">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="ajxxRecord">流转记录</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="logRecord">日志记录</a>
</script>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-primary" lay-event="returnBack" >返回</button>
    </div>
</script>

<script type="text/html" id="toolbar_log">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-primary" lay-event="returnBack" >返回</button>
    </div>
</script>
<script src="/layui/layui.all.js"></script>
<script src="/layui-ext/selectM/selectM.js"></script>
<script src="/js/core.util.js"></script>
<script language="JavaScript" src="/newmain/js/bizjs/gy.js"></script>
<script>
    //获取token
    var token = CoreUtil.getData("access_token");
    //地址栏转义token中的#号
    let tokenQuery = token.replace("#", "%23");
    let tableIns1;
    let ajztDms;
    let table = layui.table;
    let form = layui.form;
    let layer = layui.layer;
    let $ = jQuery = layui.jquery;
    let whereParams = {
        "swryDm":$("#swryDm").val(),
        "swjgDm":$("#swjgDm").val(),
        "ajztDm":$("#ajztDm").val(),
    };
    layui.config({
        base: '/'
    }).extend({
        eleTree: 'layui-ext/eleTree/eleTree',
        selectM: 'layui-ext/selectM/selectM'
    }).use(['table', 'laypage', 'layer', 'laydate', 'tree', 'eleTree'], function () {
        tableIns1 = table.render({
            elem: '#ajcx_table'
            , loading: true
            , page: true //开启分页
            , contentType: 'application/json'
            , headers: {"authorization": token}
            ,where :whereParams
            , url: '/statistics/anjianxiazhuan' //数据接口
            , method: 'POST'
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据

                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                }
            }
            , cols: [
                [
                    // {type: 'checkbox', fixed: 'left'},
                    {field: 'jcajxxuuid', title: '金三案件信息表主键', width: 0,hide:true},
                    {field: 'jcajbh', title: '案件编号', width: 200},
                    {field: 'nsrmc', title: '纳税人名称', width: 200},
                    {field: 'nsrsbh', title: '纳税人识别号', width: 200},
                    {field: 'larq', title: '立案日期', width: 150},
                    {field: 'jarq', title: '结案日期', width: 150},
                    {field: 'jcswjg', title: '所在科室', width: 100},
                    {field: 'ajztmc', title: '案件状态', width: 100},
                    {field: 'zsztmc', title: '助手状态', width: 100},
                    {field: 'jcry', title: '检查人员', width: 200},
                    {field: 'jcdjrq', title: '检查登记日期', width: 150},
                    {field: 'jcjsrq', title: '检查结束日期', width: 150},
                    {field: 'slry', title: '审理人员', width: 200},
                    {field: 'sldjrq', title: '审理登记日期', width: 150},
                    {field: 'sljsrq', title: '审理结束日期', width: 150},
                    {field: 'zxry', title: '执行人员', width: 200},
                    {field: 'zxdjrq', title: '执行登记日期', width: 150},
                    {field: 'zxwbrq', title: '执行完毕日期', width: 150},
                    {field: 'cbse', title: '查补额', width: 150},
                    {field: 'rkse', title: '入库额', width: 150},
                    {field: 'ts', title: '案源数量', width: 150},
                    {toolbar: '#ajxxtool', title: '操作',width: 200,align : 'center'}
                ]
            ]
            // , toolbar: '#toolbar'
        });
        table.on('tool(ajcx_table)', function (obj) {
            var data = obj.data;
            switch (obj.event) {
                case 'ajxxRecord':
                    //加载flowrecord
                    table.render({
                        elem: '#flowRecord_table'
                        , contentType: 'application/json'
                        , headers: {"authorization": token}
                        , where: {relevance:data.jcajxxuuid}
                        , url: '/attention/attentionCase/flowRecord' //数据接口
                        , method: 'POST'
                        , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                            return {
                                "code": res.code, //解析接口状态
                                "msg": res.msg, //解析提示文本
                                "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                                "data": CoreUtil.isEmpty(res.data) ? null : res.data //解析数据列表
                            }
                        }
                        , cols: [
                            [
                                {field: 'category', title: '类型', width: 250,align : 'center'},
                                {field: 'date', title: '日期', width: 120,align : 'center'},
                                {field: 'czr', title: '操作人', width: 140,align : 'center'},
                                {field: 'ajbh', title: '案件编号', width: 200,align : 'center'},
                                {field: 'nsrmc', title: '企业名称', width: 250,align : 'center'},
                                {field: 'czsj', title: '操作时间', width: 120,align : 'center'},
                                {field: 'bz', title: '内容', width: 250,align : 'center'},

                            ]
                        ]
                        , toolbar: '#toolbar'
                    });
                    $(".ajxx_record_div").show();
                    $(".cqyj_table_div").hide();
                    break;
                case 'logRecord':
                    //日志记录
                    skipOpen("/index/statistics/ajlogrecord?relevance=" + data.jcajxxuuid, "11002", "日志记录");
                    // table.render({
                    //     elem: '#logRecord_table'
                    //     , contentType: 'application/json'
                    //     , headers: {"authorization": token}
                    //     , where: {relevance:data.jcajxxuuid}
                    //     , url: '/attention/attentionCase/logRecord' //数据接口
                    //     , method: 'POST'
                    //     , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                    //         return {
                    //             "code": res.code, //解析接口状态
                    //             "msg": res.msg, //解析提示文本
                    //             "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                    //             "data": CoreUtil.isEmpty(res.data) ? null : res.data //解析数据列表
                    //         }
                    //     }
                    //     , cols: [
                    //         [
                    //             {field: 'ajbh', title: '案件编号', width: 200,align : 'center'},
                    //             {field: 'ajmc', title: '案件名称', width: 200,align : 'center'},
                    //             {field: 'nsrsbh', title: '纳税人识别号', width: 200,align : 'center'},
                    //             {field: 'nsrmc', title: '企业名称', width: 250,align : 'center'},
                    //             {field: 'cjsj', title: '日志日期', width: 250,align : 'center'},
                    //             {field: 'wcgz', title: '完成工作', width: 200,align : 'center'},
                    //             {field: 'fxwt', title: '发现问题', width: 250,align : 'center'},
                    //             {field: 'xbds', title: '下步打算', width: 250,align : 'center'}
                    //
                    //         ]
                    //     ]
                    //     , toolbar: '#toolbar'
                    // });
                    // $(".log_record_div").show();
                    // $(".cqyj_table_div").hide();
                    break;
            }
        });
        table.on('toolbar(flowRecord_table)', function (obj) {
            $(".ajxx_record_div").hide();
            $(".cqyj_table_div").show();
        });

        table.on('toolbar(logRecord_table)', function (obj) {
            $(".log_record_div").hide();
            $(".cqyj_table_div").show();
        });
    });
</script>
</html>